<%@ page language="java" import="java.util.*" pageEncoding="utf-8" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib prefix="s" uri="/struts-tags" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
	<meta http-equiv=content-type
		  content="text/html; charset=UTF-8;charset=utf-8"/>
	<title>18团购 - 管理后台</title>
	<link rel="stylesheet" href="../css/index.css" type="text/css" media="screen" charset="utf-8"/>
	<link rel="stylesheet" href="../css/jquery-ui-1.8.14.custom.css" type="text/css" media="screen" charset="utf-8"/>
	<script type="text/javascript" src="../js/jquery-1.6.js"></script>
	<script type="text/javascript" src="../js/jquery-ui-1.8.14.custom.min.js"></script>
	<script type="text/javascript" src="../js/common.js"></script>
	<script type="text/javascript">
		$(document).ready(function() {
			$('#merchant_li').attr("class", "current");

			$("#dialog:ui-dialog").dialog("destroy");

			$("#dialog-merchant").dialog({
				autoOpen: false,
				height: 580,
				width: 520,
				modal: true,
				show: "clip",
				hide: "slide",
				buttons: {
					"确定": function() {
						$('#form-merchant :submit').click();
					},
					"关闭": function() {
						$(this).dialog('close');
					}
				}
			});
		})
	</script>
</head>
<body class="newbie">
<div id="pagemasker"></div>
<div id="dialog"></div>
<div id="doc">
	<jsp:include page="../common/adminHeader.jsp"/>
	<div id="bdw" class="bdw">
		<div id="bd" class="cf">
			<div id="coupons">
				<div class="dashboard" id="dashboard">
					<ul>
						<li class="current">
							<a href="/admin/listMerchant.action">商户列表</a><span></span>
						</li>
					</ul>
				</div>
				<div id="content" class="coupons-box clear mainwide">
					<div class="box clear">
						<div class="box-top"></div>
						<div class="box-content">
							<div class="head">
								<h2>商户列表<a href="#" onclick="$('#dialog-merchant').dialog('open')"><img
										src="../image/common/add.png" alt="添加" title="添加"/>
								</a></h2>
							</div>
							<div class="sect">
								<table id="orders-list" cellspacing="0" cellpadding="0"
									   border="0" class="coupons-table">
									<tr>
										<th width="30">ID</th>
										<th width="250">商户名</th>
										<th width="80">网址</th>
										<th width="220">地址</th>
										<th width="100">联系电话</th>
										<th width="50">操作</th>
									</tr>
									<s:iterator id="merchant" value="merchants">
										<tr class="alt" id="team-list-id-3">
											<td>${merchant.id}</td>
											<td>${merchant.name}</td>
											<td>${merchant.url}</td>
											<td>${merchant.address}</td>
											<td>${merchant.phoneNumber}</td>
											<td class="op">
												<a href="/admin/editMerchant.action?id=${merchant.id}"><img
														src="../image/common/edit.png" alt="编辑" title="编辑"/></a>
												<a onclick="confirmDelete('确认删除商户${merchant.name}?<br><br>此操作无法恢复!',
												   '/admin/deleteMerchant.action?id=${merchant.id}')" href="#"><img
														src="../image/common/cross.png" alt="删除" title="删除"/></a>
											</td>
										</tr>
									</s:iterator>
									<tr>
										<jsp:include page="../common/pager.jsp"/>
									</tr>
								</table>
							</div>
						</div>
						<div class="box-bottom"></div>
					</div>
				</div>
			</div>
		</div>
	</div>
	<jsp:include page="../common/dialog/merchant_dialog.jsp"/>
	<jsp:include page="../common/footer.jsp"/>
</div>
</body>
</html>